<?php

namespace app\im\Router\impl;

use app\cms\middleware\saasAccount;
use app\im\liveChat\chatController;

class Routers {

    // 路由组
    // event => rule
    public array $routers = [
        // event => []
        'chat' => [
            chatController::class.'@test',
            chatController::class.'@test', // * -> function
            // 通配方法
            'test1/*' => chatController::class.'@*',
            'test/sb' => [
                chatController::class.'@test',
                'test1' => chatController::class.'@test',
            ]
        ]
    ];

    // 中间件
    protected array $middleware = [
        saasAccount::class
    ];

    /**
     * @return array
     */
    public function getRouters(): array
    {
        return $this->routers;
    }

    /**
     * @return array
     */
    public function getMiddleware(): array
    {
        return $this->middleware;
    }
}